cmake_minimum_required(VERSION 3.8)
project(input)

set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(std_msgs REQUIRED)
find_package(general_interface REQUIRED)
find_package(asio-driver REQUIRED)

add_executable(remote src/remote.cpp)
target_link_libraries(remote asio_driver)
ament_target_dependencies(remote rclcpp std_msgs general_interface)
install(TARGETS remote RUNTIME DESTINATION lib/${PROJECT_NAME})

add_executable(joystick src/joystick.cpp)
target_link_libraries(joystick asio_driver)
ament_target_dependencies(joystick rclcpp std_msgs general_interface)
install(TARGETS joystick RUNTIME DESTINATION lib/${PROJECT_NAME})


add_executable(joystick_double src/joystick_double_control.cpp)
target_link_libraries(joystick_double asio_driver)
ament_target_dependencies(joystick_double rclcpp std_msgs general_interface)
install(TARGETS joystick_double RUNTIME DESTINATION lib/${PROJECT_NAME})

ament_package()
